$("#friendLinkForm").validate({
    rules: {
    	title: 'required',
    	linkUrl: 'required'
    },
    messages: {
    	title: {
            required: "请输入友情链接实体名称"
        },
        linkUrl: {
            required: "请输入实体链接地址"
        }
    }
});

$(function(){
    // 初始化上传组件
    $('#fileupload').fileupload({
        dataType : 'json',
        done : function(e, data) {
            if (data.result.status == 'ok') {
                $('#js_url').val(data.result.url);
                $('#preview').attr('src', data.result.url);
            }
        }
    });
});
